using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace ExcellOnServices.Models
{
    public partial class Product
    {
        private const double DEFAULT_DISCOUNT = 0;
        public Product()
        {
            this.OrderItems = new List<OrderItem>();
        }

        public int Id { get; set; }

        [Required]
        public string Name { get; set; }

        [Required]
        public string ImageUrl { get; set; }

        [Required]
        [DisplayFormat(DataFormatString = "{0:c}")]
        public decimal Price { get; set; }

        [DefaultValue(DEFAULT_DISCOUNT)]
        [DisplayFormat(DataFormatString = "{0:c}")]

        public decimal Discount { get; set; }

        public Boolean Published { get; set; }

        [Required]
        [AllowHtml]
        public string Description { get; set; }

        public string Properties { get; set; }
        public Nullable<System.DateTime> CreatedDateTime { get; set; }
        public Nullable<System.DateTime> ModifiedDateTime { get; set; }
        public int Company_Id { get; set; }
        public int Category_Id { get; set; }
        public virtual Accounts_Company Accounts_Company { get; set; }
        public virtual Category Category { get; set; }
        public virtual ICollection<OrderItem> OrderItems { get; set; }
    }
}
